fix(cli): clear getopt optarg for optional long options#21902
Merged
iluuu1994 merged 1 commit intophp:masterfrom May 1, 2026
Merged
fix(cli): clear getopt optarg for optional long options#21902iluuu1994 merged 1 commit intophp:masterfrom
iluuu1994 merged 1 commit intophp:masterfrom
Conversation
Member
|
CI failures are related. |
db9964d to
7276abb
Compare
Technically this applies to other SAPIs, but CLI is currently the only one with a flag with an optional value. The PHP getopt() implementation already clears php_optarg by-hand. Fixes phpGH-21901 Closes phpGH-21902 Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
7276abb to
893bc0a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
php_getopt()left*optargunchanged when a long option with an optional argument was passed without a value, so the CLI parser could reuse the previous option's argument for--ini.Clear
optargat the start ofphp_getopt()and add a regression test that exercises-d foo=bar --ini.Fixes #21901